#ifndef _H_X_WAVTAB
#define _H_X_WAVTAB

#include <QWidget>
#include <QPushButton>
#include <QLineEdit>
#include <QTextStream>
#include <QGroupBox>
#include <QLayout>
#include <QLabel>
#include <MediaObject>
#include <AudioOutput>
#include <SeekSlider>
#include "Basic.h"
#include "XWav.h"

class XWavTab : public QWidget {
	Q_OBJECT
	
	Phonon::MediaObject *media;
	Phonon::AudioOutput *output;
	
	QString fileName;
	QLabel *fileLabel;
	QLabel *timeLabel;
	QPushButton *openButton;
	QPushButton *playButton;
	Phonon::SeekSlider *seekSlider;

	QGroupBox *convertGroup;
	QLineEdit *outputEdit;
	XWav *wav;
	QPushButton *convertButton;
	
	void setupUI();
	
private slots:
	void tick(qint64 time);
	void stateChanged(Phonon::State newState, Phonon::State);
	void openButtonClicked();
	void playButtonClicked();
	void convertButtonClicked();
	
public:
	XWavTab(QWidget *parent = 0);
};

#endif
